package com.basketball.gym.service;

import com.basketball.gym.pojo.Finance;
import com.basketball.gym.pojo.ResponseData;
import com.basketball.gym.pojo.User;
import com.basketball.gym.pojo.Wallet;
import com.baomidou.mybatisplus.extension.service.IService;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author 赵肖云
 * @since 2021-03-27
 */
public interface WalletService extends IService<Wallet> {

    /**
     * 查询钱包
     */
    ResponseData<Wallet> getWallet(User user);

    /**
     * 管理员通过手机号充值
     */
    ResponseData<Wallet> topUp(@NotNull(message = "手机号不能为空") String phone, @Min(value = 0, message = "price不能小于0") @NotNull(message = "price不能为空") Double price);

    /**
     * 使用入场券
     */
    ResponseData<Wallet> useTicket(@NotNull(message = "手机号不能为空") String phone, @Min(value = 0, message = "ticketNum不能小于0") @NotNull(message = "ticketNum不能为空") Integer ticketNum);

    /**
     * 使用余额
     */
    ResponseData<Object> useBalance(Finance finance);

    /**
     * 通过手机号查询钱包
     */
    ResponseData<Wallet> getWalletByPhone(String phone);

    /**
     * 管理员查询钱包
     */
    ResponseData<List<Wallet>> adminGetWallet(String phone);
}
